package com.sdgs.paas.sdk.core.mq;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * ctqmq启动配置
 *
 * @author wjj
 *
 */
@ConfigurationProperties(prefix = "ctgmq")
public class CtgMqConfig {
	boolean enable;
	boolean disableProducer;
	boolean disablePullConsumer;
	boolean disableConsumer;
	// nameserver地址
	String namesrvAddr;
	String authID;
	String authPWD;
	// 生产者组名
	// String producerGroupName;
	// 客户端发送的最大消息大小,默认为128k
	int maxMessageSize;
	// 发送的超时时间时，默认为3s
	int sendMsgTimeout;
	// 发送的压缩大小,可以不设置默认为4k
	int compressMsgBodyOverHowmuch;
	// 消费者组名
	// String consumerGroupName;
	// 设置消费模式，包括（1）集群消费或广播消费（2）有序消费或无序消费。
	// 默认是集群消费、无序消费； 队列消费必须设置成为有序消费模式
	boolean consumeOrderly;
	// push消费一次拉取条数，默认为1
	int batchSize;
	int consumerClientCallbackExecutorThreads;
	int consumerClientWorkerThreads;
	int consumerAbMsgProcNetCallbackExecutorThreads;
	int consumerAbMsgProcNetWorkerThreads;

	// List<String> topics;
	List<ConsumerGroup> consumerGroup;
	List<ProducerGroup> producerGroup;

	List<PullConsumerGroup> pullConsumerGroup;

	/**
	 * @return the namesrvAddr
	 */
	public String getNamesrvAddr() {
		return namesrvAddr;
	}

	/**
	 * @param namesrvAddr
	 *            the namesrvAddr to set
	 */
	public void setNamesrvAddr(String namesrvAddr) {
		this.namesrvAddr = namesrvAddr;
	}

	/**
	 * @return the authID
	 */
	public String getAuthID() {
		return authID;
	}

	/**
	 * @return the authPWD
	 */
	public String getAuthPWD() {
		return authPWD;
	}

	/**
	 * @return the maxMessageSize
	 */
	public int getMaxMessageSize() {
		return maxMessageSize;
	}

	/**
	 * @param authID
	 *            the authID to set
	 */
	public void setAuthID(String authID) {
		this.authID = authID;
	}

	/**
	 * @param authPWD
	 *            the authPWD to set
	 */
	public void setAuthPWD(String authPWD) {
		this.authPWD = authPWD;
	}

	/**
	 * @param maxMessageSize
	 *            the maxMessageSize to set
	 */
	public void setMaxMessageSize(int maxMessageSize) {
		this.maxMessageSize = maxMessageSize;
	}

	// /**
	// * @return the consumerGroupName
	// */
	// public String getConsumerGroupName() {
	// return consumerGroupName;
	// }

	/**
	 * @return the consumeOrderly
	 */
	public boolean isConsumeOrderly() {
		return consumeOrderly;
	}

	/**
	 * @return the batchSize
	 */
	public int getBatchSize() {
		return batchSize;
	}

	/**
	 * @return the consumerClientCallbackExecutorThreads
	 */
	public int getConsumerClientCallbackExecutorThreads() {
		return consumerClientCallbackExecutorThreads;
	}

	/**
	 * @return the consumerClientWorkerThreads
	 */
	public int getConsumerClientWorkerThreads() {
		return consumerClientWorkerThreads;
	}

	/**
	 * @return the consumerAbMsgProcNetCallbackExecutorThreads
	 */
	public int getConsumerAbMsgProcNetCallbackExecutorThreads() {
		return consumerAbMsgProcNetCallbackExecutorThreads;
	}

	/**
	 * @return the consumerAbMsgProcNetWorkerThreads
	 */
	public int getConsumerAbMsgProcNetWorkerThreads() {
		return consumerAbMsgProcNetWorkerThreads;
	}

	// /**
	// * @param consumerGroupName the consumerGroupName to set
	// */
	// public void setConsumerGroupName(String consumerGroupName) {
	// this.consumerGroupName = consumerGroupName;
	// }

	/**
	 * @param consumeOrderly
	 *            the consumeOrderly to set
	 */
	public void setConsumeOrderly(boolean consumeOrderly) {
		this.consumeOrderly = consumeOrderly;
	}

	/**
	 * @param batchSize
	 *            the batchSize to set
	 */
	public void setBatchSize(int batchSize) {
		this.batchSize = batchSize;
	}

	/**
	 * @param consumerClientCallbackExecutorThreads
	 *            the consumerClientCallbackExecutorThreads to set
	 */
	public void setConsumerClientCallbackExecutorThreads(int consumerClientCallbackExecutorThreads) {
		this.consumerClientCallbackExecutorThreads = consumerClientCallbackExecutorThreads;
	}

	/**
	 * @param consumerClientWorkerThreads
	 *            the consumerClientWorkerThreads to set
	 */
	public void setConsumerClientWorkerThreads(int consumerClientWorkerThreads) {
		this.consumerClientWorkerThreads = consumerClientWorkerThreads;
	}

	/**
	 * @param consumerAbMsgProcNetCallbackExecutorThreads
	 *            the consumerAbMsgProcNetCallbackExecutorThreads to set
	 */
	public void setConsumerAbMsgProcNetCallbackExecutorThreads(int consumerAbMsgProcNetCallbackExecutorThreads) {
		this.consumerAbMsgProcNetCallbackExecutorThreads = consumerAbMsgProcNetCallbackExecutorThreads;
	}

	/**
	 * @param consumerAbMsgProcNetWorkerThreads
	 *            the consumerAbMsgProcNetWorkerThreads to set
	 */
	public void setConsumerAbMsgProcNetWorkerThreads(int consumerAbMsgProcNetWorkerThreads) {
		this.consumerAbMsgProcNetWorkerThreads = consumerAbMsgProcNetWorkerThreads;
	}

	/**
	 * @return the sendMsgTimeout
	 */
	public int getSendMsgTimeout() {
		return sendMsgTimeout;
	}

	/**
	 * @return the compressMsgBodyOverHowmuch
	 */
	public int getCompressMsgBodyOverHowmuch() {
		return compressMsgBodyOverHowmuch;
	}

	// /**
	// * @return the topics
	// */
	// public List<String> getTopics() {
	// return topics;
	// }

	/**
	 * @param sendMsgTimeout
	 *            the sendMsgTimeout to set
	 */
	public void setSendMsgTimeout(int sendMsgTimeout) {
		this.sendMsgTimeout = sendMsgTimeout;
	}

	/**
	 * @param compressMsgBodyOverHowmuch
	 *            the compressMsgBodyOverHowmuch to set
	 */
	public void setCompressMsgBodyOverHowmuch(int compressMsgBodyOverHowmuch) {
		this.compressMsgBodyOverHowmuch = compressMsgBodyOverHowmuch;
	}

	/**
	 * @return the consumerGroup
	 */
	public List<ConsumerGroup> getConsumerGroup() {
		return consumerGroup;
	}

	/**
	 * @param consumerGroup
	 *            the consumerGroup to set
	 */
	public void setConsumerGroup(List<ConsumerGroup> consumerGroup) {
		this.consumerGroup = consumerGroup;
	}

	/**
	 * @return the producerGroup
	 */
	public List<ProducerGroup> getProducerGroup() {
		return producerGroup;
	}

	/**
	 * @param producerGroup
	 *            the producerGroup to set
	 */
	public void setProducerGroup(List<ProducerGroup> producerGroup) {
		this.producerGroup = producerGroup;
	}

	public List<PullConsumerGroup> getPullConsumerGroup() {
		return pullConsumerGroup;
	}

	public void setPullConsumerGroup(List<PullConsumerGroup> pullConsumerGroup) {
		this.pullConsumerGroup = pullConsumerGroup;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public boolean isDisableProducer() {
		return disableProducer;
	}

	public void setDisableProducer(boolean disableProducer) {
		this.disableProducer = disableProducer;
	}

	public boolean isDisablePullConsumer() {
		return disablePullConsumer;
	}

	public void setDisablePullConsumer(boolean disablePullConsumer) {
		this.disablePullConsumer = disablePullConsumer;
	}

	public boolean isDisableConsumer() {
		return disableConsumer;
	}

	public void setDisableConsumer(boolean disableConsumer) {
		this.disableConsumer = disableConsumer;
	}



	// /**
	// * @param topics the topics to set
	// */
	// public void setTopics(List<String> topics) {
	// this.topics = topics;
	// }

}
